home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 June (IDG) / Macworld_June_2000.iso / Shareware World / Utilities / Text Processing / Jedit3.0 / Manual / Chap5 Search < prev    next >
Encoding:
Text File  |  2000-03-21  |  19.1 KB  |  372 lines  |  [TEXT/JED3]

  1. Chapter 5 - Search
  2.  
  3. 5.1 Finding Text
  4.  
  5. To find a string, select the "Find..." of the menu "Search". Then a dialog box named "Find Settings" will appear as shown below.
  6.  
  7.             
  8.  
  9. Type the string that you want to search in the "Find:" field and push the "Find" button.  Then searching will start from the current cursor position and if found, the string will be highlighted in the document.
  10.  
  11. To search for the next occurrence, push the "Find" button again.  When there are no more occurrences, a beep sound will tell you that the search is over.  You can also do this function by selecting the "Find Next" of the menu "Edit".
  12.  
  13. If you push the "Find All" button, all occurrences will be listed up in a mark list window as shown below.
  14.  
  15.             
  16.  
  17. If you double click on one item of the mark list, the corresponding line will  appear in the document window.
  18.  
  19. If you push the  button at the upper left side of the find field, the pop-up menu  containing last 10 searched strings will appear.  If you select an item, it will be copied into the find field.
  20.  
  21. If you push the  button at the lower left side of the find field, the sample pattern popup menu as follows will appear.  If you select an item, it will be inserted into the find field. (Using ResEdit, you can modify these patterns which are stored as  #STR 3000 in the resource fork. )
  22.  
  23.             
  24.             
  25. To specify unprintable characters in the find field, use the following "\" key combinations: 
  26. If you want to search for non-printing characters, use the following combinations ("\" and a character) in the find field: 
  27.  
  28.      \t=TAB,  \r=CR,  \n=LF,  \s=SPACE,  \b=Backspace.  
  29.      
  30. Other combinations using the "\" key  will be explained later at the section of  the Regular Expressions. 
  31.  
  32. If you want to search for the text you see in the current document, select that text and use the "Enter 'Find' String" of the menu "Search". That text will be copied into the find field of the find dialog.
  33.  
  34. If you select the menu "Find Selection", the highlighted text will be copied into the find dialog and will be searched automatically. 
  35.  
  36. If you check the box "Backwards", the search will start from the cursor position and go back to the top of the document.
  37.  
  38. Normally Jedit will stop searching when it reaches the end of the document. If you want to continue searching from the top of the document, check the box "Wrap Around".
  39.  
  40. If you check the box "Case Sensitive", Jedit will treat upper- and lowercase characters as different ones. Otherwise, it will ignore the difference of upper- and lowercases.
  41.  
  42. if you check the box "Hankaku/Zenkaku Sensitive", Jedit will treat hankaku and zenkaku characters as different ones. Otherwise, it will ignore the difference of hankaku and zenkaku. This option is valid in only the Japanese text.  Check this when you use other languages.
  43.  
  44. If you check the box "Entire Word", Jedit matches the search string only if it is surrounded in the document text by word-break characters (white space or punctuation). Otherwise Jedit matches the search string anywhere in the text. 
  45.  
  46. If you check the box " RegExp", you can use the patterns of the regular expressions in the find field.   Using the expressions below, you can specify the word patterns without knowing the exact words contained in the text.
  47.  
  48. When you push the  button, the help window for the regular expressions will appear:
  49.             
  50.  
  51. Regular Expressions
  52.  
  53. Using the expressions below, you can specify the word patterns without knowing the exact words contained in the text.  Jedit can also handle  Japanese 2-bytes characters  in the regular expressions.
  54.  
  55. ^    beginning of line  (if ^ is the first character in the pattern)
  56.         Example:    ^subj:
  57.         searches for a pattern of text beginning with "subj:"
  58.  
  59. $    end of line  (if $ is the last character in the pattern)
  60.         Example:    ^$
  61.         searches for a blank line that only contains a carriage
  62.         return.
  63.         When you use "$",  the searched result will not include the
  64.         carriage return.
  65.         If you use "\r", instead of "$", the searched result will
  66.         include the return code. 
  67.  
  68. .    represents any character
  69.         Example:    a.d
  70.         will find words that begin with an "a", followed by any
  71.         character, then followed by a "d".
  72.         Possible matches:  "and",  "add", "dandy"
  73.         
  74. *    means a designated character repeats more than once or never exists.
  75.         Example:    an*d
  76.         will represent a word that starts with an "a", followed by
  77.         an "n" which is repeated 0 or more times, then followed
  78.         by a "d."
  79.         Possible matches:  "and", "advance", "add"
  80.  
  81. *?   same as "*" but it matches the minimum number of times possible.
  82.         For example, If you search ".*bbb" in the text  
  83.         "aaa bbb bbbbbb cccc", 
  84.         the string "aaa bbb bbb bbb" will be matched. 
  85.         But if you search ".*?bbb" in it, the string "aaa bbb" will be
  86.         matched.
  87.  
  88. +    means a designated character repeats more than once.
  89.         Example:    an+d
  90.         will indicates any word that begins with an "a", followed by
  91.         an "n"
  92.         which is repeated more than once, followed by a "d".
  93.         It matches in "and",  "annd"  but not "advance", "add".
  94.  
  95. +?    same as "+" but it matches the minimum number of times possible.
  96.  
  97. ?    means a designated character exists once or never.
  98.         Example:    an?d
  99.         will represent words begin with "a", followed by either "n" or
  100.         nothing, then followed by a "d". It matches in "and", "add" but not
  101.         "annd".
  102.         
  103. ??    same as "?" but it matches the minimum number of times possible.
  104.  
  105. \    represents an escape mark
  106.             Use this escape mark to search for the characters such as  '^',
  107.             '$', '\' that have the special meanings in the regular expression.
  108.             
  109.                  Example:   \^   \\  \$  \*  \+
  110.  
  111.             You can also use that escape mark to search for none-printing
  112.             characters as follows.
  113.             
  114.              '\t' =TAB, '\r' =CR, '\n' =LF, '\s' =SPACE, '\b' =BS
  115.      
  116.             To express characters as hexadecimal codes, use '\h'
  117.             followed by its hexadecimal codes.
  118.      
  119.                   Example:   \h20        1-byte space
  120.                  Example:   \h8140    2-bytes kanji space
  121.      
  122. [ ]    represents character classes
  123.         To express the range of the characters, use  [ - ]  expression.
  124.         To express the exclusion of the characters,  use  [^ ] expression.
  125.         This function can also be used for 2-byte characters.
  126.  
  127.     Example:      [abc]
  128.             a character that matches for the characters a or b or c.
  129.              [A-Z]
  130.              a character that matches from A to Z, any capital
  131.              alphabets.
  132.              [^a-z]    
  133.              any character other than a to z.
  134.              [a-xABC]
  135.              any character from a to x or any of A, B, C.
  136.              [\t\s\h8140]+$
  137.              tabs, spaces or kanji spaces at the end of line.
  138.  
  139. {}    represents a group
  140.         Use {} to divide find strings into desired groups that are
  141.         used in the replacement strings.
  142.  
  143.         For example, a person name will be expressed as follows.
  144.       
  145.               {[A-Z][a-z]+}\s+{[A-Z][a-z]+}
  146.  
  147.         Expression {[A-Z][a-z]+} means one capital alphabet [A-Z] is
  148.         followed by more than one small letters [a-z]+.
  149.         First group {[A-Z][a-z]+} is the given name.
  150.                Second group {[A-Z][a-z]+} is the family name.
  151.                First group and Second group are separated by more than one
  152.                spaces \s+ .
  153.  
  154.         You can specify the first group as  \1 , and the second group as 
  155.         \2. You can use these numbers in the Replacement process.
  156.         
  157.         For example ,if you want to form the strings of personal
  158.         names in
  159.         your document into the "family name first style", use the
  160.         following string as a replacement string.
  161.       
  162.              \2, \1
  163.       
  164.         And push the "Replace" button , then family names will come
  165.         first , a comma and given names will follow.
  166.  
  167.  
  168.  
  169. 5.2 Replace
  170.  
  171.  
  172. If you want to replace some string with the other string, use the replacement function.  First, be sure to fill both the find and replacement field in the "Find Settings" dialog.   Next, search for the find string by pushing the "Find" button or selecting the "Find Next" of the menu "Search".
  173. When that string is found, then do the replacement process by the use of either the "Replace" and "Replace & Find" buttons in the find dialog or selecting the "Replace" and "Replace & Find Next" items in the menu "Search".
  174.  
  175. By selecting the "Replace & Find Next" of the menu "Search", the string will be replaced with the replacement string and the next occurrence of find string will be searched.  You can do the same thing by pushing the button  "Replace" or "Replace & Find" in the find dialog.
  176.  
  177. If you select the "Replace All" of the menu "Search" or in the find dialog, all the occurrences in the selected area will be replaced with the replacement string.
  178.  
  179. When the target area is not selected, the "Replace All" will be carried out from the cursor position to the end of the document.
  180. If you push the  button at the left side of the replace field, the pop-up menu containing last 10 replacement strings will appear.  If you select an item, it will be copied into the replace field.
  181.  
  182.  
  183.  
  184.  
  185. 5.3 Multi-File Search & Replace
  186.  
  187. Jedit can find and replace strings on multiple files. 
  188.  
  189.         
  190. To switch from the normal search to the multi-file search mode, push the button  .  Then the button will turn to be the depressed  shape indicating the multi-file search mode is on.  By pushing the small arrow  at left side of the button, you can show or hide the target file list for the multi-file search.
  191.  
  192. To add files to the target file list, push the "Add" button.
  193.  
  194. If your system supports Navigation Service, the following file dialog will appear. The files that match the "Readable File Types" in the "Open" preferences will be listed in the dialog.
  195.  
  196.         
  197.  
  198. Select more than one files in this dialog and push the "Choose" button. Then they will be added to the target file list.  Also if you select a folder, all files contained within the folder and its subfolders will be added to the target file list.
  199.  
  200. If Navigation Service was not supported, the following selection dialog will appear.
  201.             
  202.  
  203. Select the file you want to add to the target list, and push the "Add" button.  If you push the button "All Listed Files", all the files in the list box will be added to the target file list.  If you push the button "All Files in the Folder", all the text files in the selected folder (including subfolders)  will be added to the target file list.
  204.  
  205. Also you can drag and drop files or folders directly onto the target list.
  206.  
  207.             
  208.  
  209. To start the multi-file searching, push the button "Find" or "Find All" in the find dialog or select the "Find Next" or "Find All" of the menu "Search".
  210.  
  211. When you push the "Find" button, the document window opens each time the string is found.  To continue searching, push the "Find" button again or select the menu "Find Next".  If you want to end the search in the current document and make the next search  in the next documets , select the "Find Next File" of the menu "Search".
  212.  
  213. To begin searching from the next file, select the menu "Find Next File". 
  214.  
  215. Also in the multi-file search mode ,the "Replace & Find" button in the find dialog and the "Replace & Find Next" of the menu "Search" will do the same work as in the normal search mode.
  216.  
  217. If you push the button "Find All" in the find dialog or you select the "Find All" of the menu "Search", all the occurrences in the target files will be listed up in the mark list as shown below.
  218.  
  219.             
  220.  
  221. If you double click on one of the found items in the mark list, the corresponding text will appear in the document window.  If you double click on the file item in the mark list, the corresponding file will be opened.
  222.  
  223. When you push the button "Replace All", all occurrences in the target files will be replaced with the replacement string and the following confirmation dialog will appear.
  224.  
  225.             
  226.  
  227. Warnimg: Don't forget to save the documents before closing them.  Otherwise, you will lose the replacements you just made.
  228.  
  229.  
  230. How to Use the Target File List in the "Find Setting Dialog"
  231.  
  232. If you want to remove a file from the target file list,  select the name of that file and push the "Delete" button.  If you want to clear all files from the list box, push the "Clear" button.
  233.  
  234.         
  235.  
  236. If you want to open a file in the target file list, double click on the name of that file.
  237.  
  238. The "" mark indicates that the file has not been searched yet. If you want to skip a file in the search, remove the  "" mark at the left side of the file's name by clicking it.  If you click the "" mark with the shift key down, all the " marks of the files located above from where you clicked will be removed. 
  239.  
  240. If you use the same target list frequently, you can register that list in the "File Sets" pop-up menu.  Push the "Register File Set" button, then the following dialog will appear.
  241.  
  242.                 
  243.  
  244. Enter the name of the set you want to register and click the "Register" button, then the current target file list will be registered in the "File Sets" pop-up menu.  
  245.  
  246. To use a registered file set, push the pop-up menu button  and selet the name of set you want .  Then the all the names of that set will appear in the target file list.
  247.  
  248. To remove a file set from the "File Sets" pop-up menu, push the pop-up menu button with the option key down and select the namen of file set you want to remove.
  249.  
  250.  
  251.  
  252.  
  253. 5.4 Sherlock FBC Search
  254.  
  255. MacOS 8.5 or higher supports "Sherlock Find By Contents (FCB)" function that allows you to quickly search contents of entire disks.
  256.  
  257. Jedit also supports Sherlock FBC search but it is slightly different from Finder's and more powerful.   You may open the file and jump to the chosen search word directly
  258.  
  259. Select the "Sherlock FCB Search..." of the menu "Search". The following dialog box will appear: 
  260.             
  261.  
  262. Enter more than one word into "Words" field and check the boxes at the left side of the drives that you want to search. 
  263.  
  264. The results will be displayed in the mark list as shown below.  With Finder's Sherlock search, the results will only show the names of files that contain the searched words. However, when you use the Jedit's Sherlock, the results will also show the content locations of the searched words.
  265.  
  266.             
  267.  
  268. To see the corresponding  text that includes the searched words, double click on the item from the list. Then that text will appear in the document window of Jedit.
  269.  
  270. Notes when Using Sherlock
  271.     1. You need to index the volumes before you use the Sherlock FCB
  272.     search. To index the volumes, select "Find..." from the "File" menu
  273.     of the Finder.   Otherwise, select "Sherlock" from the Apple menu.
  274.     (For further details of indexing volumes for Sherlock, see "MacHelp".)
  275.     2. The mark list will display the first occurrence of each file.  If you
  276.     want to list up all occurrences in that file, use Jedit's "Find All"
  277.     function for the file.
  278.     3. Sherlock can not search the files of none-Mac encodings. If you
  279.     want search the text files of none-Mac encodings such as JIS, EUC
  280.     or Unicode, use the multi-file search of Jedit instead.
  281.  
  282.  
  283. 5.5 Mark
  284.  
  285.  
  286. You can mark the location of a certain text area in the document and make the list of those locations in the mark list.  You can jump back to the marked text area from the mark list any time you want.
  287.  
  288. Highlight the text area you want to mark and select the "Mark" of the menu "Search", then  the mark list will be opened automatically and the mark of that location will be registered onto the list.
  289.  
  290.             
  291.  
  292. You can also mark the text area by "Drag and Drop" of that text area  onto the mark list directly. 
  293.  
  294. If you want to jump to the marked text areas, double click on the corresponding items in the mark list.
  295.  
  296.  
  297. 5.6 Mark List
  298.  
  299. Go to the "Search" menu and select "Mark List", then the following mark list will appear:
  300.             
  301.  
  302. The mark list can contain not only the lines that you have marked but also the searched results of "Find All" and "Sherlock FCB Search" functions.
  303.  
  304. You can show or hide marked items of a file by clicking the  mark at the left side of the file items.  If you want to show or hide all marked items on the list, click one of  the  marks with the option key down.
  305.  
  306.  
  307. Jump
  308. To open a file in the mark list by its creator application, double click on the file item.  
  309. To open the marked item in the mark list  by Jedit, double click on the mark item to jump to the corresponding text.  You can also open the mark by pushing the "Jump" button at top of the mark list.
  310.  
  311. When a file is already opened as a document of Jedit3.0, that file icon will be displayed in the  shape instead of its original icon.
  312.  
  313. Remove
  314. To remove a marked item from the mark list, select that item and push the "Delete" button.  You can remove all marks of a file by selecting the file item and pushing the "Delete" button. To remove all marks in the mark list, push the "Clear All" button.
  315.  
  316. Jedit3.0 will never erase the mark items automatically.  New search results will be added to the current mark list, and will remain in the list unless you remove.
  317.  
  318. Save to the Bookmark File
  319. To save the current mark list, push the "Save" button.  Otherwise, go to the "File" menu and select "Save/Save As...". When saved, the file will appear as the following bookmark icon:
  320.                     
  321. If you want to open a bookmark file, double click on the icon.
  322. The File "Manual Index" of this manual is actually a bookmark file that was created in this way.
  323.  
  324. If you select the menu "Save As...", the save dialog as follows will appear.
  325.  
  326.         
  327.  
  328. You can select the file format from the popup menu.  
  329. If you select "Mark File", the file will be saved as a bookmark file of Jedit3.0. If you select "Text File", the same content as the mark list will be saved as a text file. If you select "Offset list", the full path names, offsets and the contents are saves as tab separeted records.
  330.  
  331. Loading a Bookmark File
  332. To add the contents of a bookmark file into the current mark list, push the "Append" button, and select a bookmark file.  The contents of that file will then be added to the current mark list.
  333.  
  334. To clear the current mark list and open a bookmark list as the new mark list, go to the "File" menu and select "Open Bookmark...". 
  335.  
  336. Dragging and Dropping Bookmark Files
  337. To add a bookmark file to the current mark list, drag the bookmark file from the Finder desktop and drop it onto the mark list.
  338.  
  339. Update of the contents of the mark list
  340. If a mark list is already open, the locations of the marks will be updated automatically as you make changes in the document window. 
  341.  
  342. If you change contents in the document while its mark list is not open, the location data in the bookmark file may not exactly correspond to the contents of the current document.  
  343.  
  344. In such a case, if you try to open that bookmark file, the following alert box will appear.
  345.  
  346.         
  347.  
  348. To update the contents of the mark list, push the "Update Marks" button. All the marks of that file will be updated.  If you want to view the text that the old mark indicates, push the "Jump Now without Update" button.
  349.  
  350. When the File is Not Found
  351. If Jedit3.0 can not find the file in the mark list, the following alert box will appear. All marks of this file will be removed.
  352.         
  353.         
  354.  
  355. Note when using Bookmark Files
  356. As the file information in the bookmark list is stored in aliases, it follows up the file name changes or the file location changes automatically. 
  357.  
  358. When moving a bookmark file and its related files to another folder or disk, be sure to maintain the relative positions between the files.  For example, when you move the bookmark file and its related files within a certain folder, you should move the folder itself. 
  359.  
  360.  
  361. 5.7 Jump by Line Number
  362.  
  363. Go to the "Search" menu and select "Go to Line/Paragraph", then  the following dialog will appear.
  364.  
  365.             
  366. Enter the line number or paragraph number where you want to jump and push the "Jump" button
  367.  
  368.  
  369.  
  370.  
  371.  
  372.